//
//  CustomOverlayView.swift
//  Koloda
//
//  Created by Eugene Andreyev on 7/27/15.
//  Copyright (c) 2015 CocoaPods. All rights reserved.
//

import UIKit
import Koloda

private let overlayRightImageName = "overlay_like"
private let overlayLeftImageName = "overlay_skip"

class CustomOverlayView: OverlayView {

    var overlayImageView = UIImageView(frame: .zero)
    
    init(overlayImageView: UIImageView = UIImageView(frame: .zero), overlayState: SwipeResultDirection? = nil) {
        super.init(frame: .zero)
        self.overlayImageView = overlayImageView


    }
    
    @MainActor required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //    @IBOutlet lazy var overlayImageView: UIImageView! = {
//        [unowned self] in
//        
//        var imageView = UIImageView(frame: self.bounds)
//        self.addSubview(imageView)
//        
//        return imageView
//        }()
    
    override var overlayState: SwipeResultDirection?  {
        didSet {
            switch overlayState {
            case .left? :
                overlayImageView.image = UIImage(named: overlayLeftImageName)
            case .right? :
                overlayImageView.image = UIImage(named: overlayRightImageName)
            default:
                overlayImageView.image = nil
            }
            
        }
    }

}
